﻿<Window x:Name="principalWindow" x:Class="CSharp2.Capitulo10.Wpf.ServicosWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Serviços" Height="604" Width="800" WindowStartupLocation="CenterScreen"
        DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <!--<Window.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
    </Window.Resources>-->
    <Grid>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFF1E7E7" Offset="0.497"/>
                <GradientStop Color="#FF0C0B0B" Offset="1"/>
                <GradientStop Color="Black" Offset="0.01"/>
            </LinearGradientBrush>
        </Grid.Background>
        <Label Content="Placa"  HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,14,0,0" />
        <TextBox x:Name="placaTextBox" HorizontalAlignment="Left" Height="22" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Margin="42,12,0,0"/>
        <Button x:Name="pesquisarButton" Content="Pesquisar" HorizontalAlignment="Left" VerticalAlignment="Top" Width="75" Margin="167,14,0,0" IsDefault="True" Click="pesquisarButton_Click"/>
        <Label Content="Modelo" HorizontalAlignment="Left" Margin="247,14,0,0" VerticalAlignment="Top"/>
        <Label Content="Cor" HorizontalAlignment="Left" Margin="418,14,0,0" VerticalAlignment="Top"/>
        <Label Content="Ano" HorizontalAlignment="Left" Margin="567,14,0,0" VerticalAlignment="Top"/>
        <TextBox Text="{Binding Veiculo.Modelo.Descricao}" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Margin="293,11,0,0" IsReadOnly="True"/>
        <TextBox Text="{Binding Veiculo.Cor.Descricao}" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Margin="442,11,0,0" IsReadOnly="True"/>
        <TextBox Text="{Binding Veiculo.AnoModelo}" HorizontalAlignment="Left" Height="23" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Margin="594,11,0,0" IsReadOnly="True" />
        <DataGrid ItemsSource="{Binding Veiculo.Servicos}" AutoGenerateColumns="False" IsReadOnly="True" Margin="10,39" x:Name="servidosDataGrid">
            <DataGrid.Columns  >
                <DataGridTextColumn Header="Tipo" Binding="{Binding Path=TipoServico.Descricao}" MinWidth="100">
                    <!--<DataGridTextColumn.CellStyle>
                        <Style TargetType="DataGridCell">
                            <Setter Property="BorderBrush" Value="Gray"></Setter>
                        </Style>
                    </DataGridTextColumn.CellStyle>-->
                </DataGridTextColumn>
                <DataGridTextColumn Header="Início" Binding="{Binding Path=DataInicio, StringFormat=\{0:dd/MM/yyyy\}}" ></DataGridTextColumn>
                <DataGridTextColumn Header="Fim" Binding="{Binding Path=DataFim, StringFormat=\{0:dd/MM/yyyy\}}"></DataGridTextColumn>
                <DataGridTextColumn Header="Valor" Binding="{Binding Path=Valor, StringFormat=\{0:c\}}"></DataGridTextColumn>
            </DataGrid.Columns>
        </DataGrid>
        <StatusBar VerticalAlignment="Bottom" Height="25" Background="Black">
            <StatusBarItem >
                <Label Content="Total:"></Label>
            </StatusBarItem>
            <StatusBarItem >
                <TextBox x:Name="totalTextBox" IsReadOnly="True" Width="100"></TextBox>
            </StatusBarItem>
            <Separator></Separator>
            <StatusBarItem HorizontalAlignment="Right">
                <ProgressBar x:Name="totalRegistrosProgressBar" Height="17" Width="100" >
                    <ProgressBar.Style>
                        <Style TargetType="ProgressBar">
                            <Setter Property="Foreground" Value="DarkGreen"/>
                            <Setter Property="Background" Value="DarkGray"/>
                        </Style>
                    </ProgressBar.Style>
                </ProgressBar>
            </StatusBarItem>
        </StatusBar>
    </Grid>
</Window>
